<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base href="<%=basePath%>">
    <link rel="stylesheet" href="static/component/pear/css/pear.css" />
    <link rel="stylesheet" href="static/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="static/css/public.css" media="all">
</head>
<body>

<div class="layuimini-container">
    <div class="layuimini-main">

        <div class="layui-card">
            <div class="layui-card-body">
                <table id="purchaseDetails" lay-filter="purchaseDetails" class="layui-hide"></table>
            </div>
        </div>


        <input type="hidden" value="${purCode}" class="purCode">
        <%--      <c:if test="${emp.eDepartment==2}">

              </c:if>--%>

        <%--    <shiro:hasAnyRoles name="库管员">
                <c:if test="${}">

                <a class="pear-btn pear-btn-success pear-btn-sm" lay-event="sp"> <i class="layui-icon layui-icon-ok">审批</i></a>

                </c:if>

            </shiro:hasAnyRoles>--%>


    </div>

</div>

</body>


<script src="static/component/layui/layui.js"></script>
<script src="static/component/pear/pear.js"></script>

<script>
    //引入table
    layui.use(['table','form'],function() {

        var $ = layui.jquery;
        var from = layui.form;
        var table = layui.table;
        var form = layui.form;
        //执行表格的数据填充操作
        table.render({
            //指定渲染的表格
            elem: '#purchaseDetails',
            //指定获取数据的路径
            url: 'purDetails/selectCodePurchase?purCode='+$(".purCode").val(),
            toolbar: '#toolbarDemo',
            //规定请求方式
            method: 'post',
            //开启分页
            page: true,
            check: true,
            //指定每页显示数
            limits: [1, 10, 15],
            even: true,
            cols: [[
                {field: 'purdeId', title: '编号', align: 'center'},
                {field: 'purCode', title: '申请单编号', align: 'center'},
                {field: 'goods', title: '商品', align: 'center',templet:"#goods"},
                {field: 'purchaseCount', title: '数量', align: 'center'},
                {field: 'purchasingPrice', title: '采购进价', align: 'center'},
                {field: 'purchasetotalPrice', title: '小计', align: 'center'}

            ]]
        })
    })
            </script>


<script type="text/html" id="goods">
    {{d.goods.goodsName}}
</script>
</html>